package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysAgreementMapper;
import com.ruoyi.project.system.domain.SysAgreement;
import com.ruoyi.project.system.service.ISysAgreementService;

/**
 * Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-14
 */
@Service
public class SysAgreementServiceImpl implements ISysAgreementService 
{
    @Autowired
    private SysAgreementMapper sysAgreementMapper;

    /**
     * 查询
     * 
     * @param agreementId ID
     * @return
     */
    @Override
    public SysAgreement selectSysAgreementById(Long agreementId)
    {
        return sysAgreementMapper.selectSysAgreementById(agreementId);
    }

    /**
     * 查询列表
     * 
     * @param sysAgreement
     * @return
     */
    @Override
    public List<SysAgreement> selectSysAgreementList(SysAgreement sysAgreement)
    {
        return sysAgreementMapper.selectSysAgreementList(sysAgreement);
    }

    /**
     * 新增
     * 
     * @param sysAgreement
     * @return 结果
     */
    @Override
    public int insertSysAgreement(SysAgreement sysAgreement)
    {
        sysAgreement.setCreateTime(DateUtils.getNowDate());
        return sysAgreementMapper.insertSysAgreement(sysAgreement);
    }

    /**
     * 修改
     * 
     * @param sysAgreement
     * @return 结果
     */
    @Override
    public int updateSysAgreement(SysAgreement sysAgreement)
    {
        sysAgreement.setUpdateTime(DateUtils.getNowDate());
        return sysAgreementMapper.updateSysAgreement(sysAgreement);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param agreementIds 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteSysAgreementByIds(Long[] agreementIds)
    {
        return sysAgreementMapper.deleteSysAgreementByIds(agreementIds);
    }

    /**
     * 删除信息
     * 
     * @param agreementId ID
     * @return 结果
     */
    @Override
    public int deleteSysAgreementById(Long agreementId)
    {
        return sysAgreementMapper.deleteSysAgreementById(agreementId);
    }

    @Override
    public SysAgreement queryAgreement(SysAgreement sysAgreement)
    {
        return sysAgreementMapper.queryByType(sysAgreement.getAgreementType());
    }

    @Override
    public List<SysAgreement> showAgreement(SysAgreement sysAgreement) {
        return sysAgreementMapper.showAgreement(sysAgreement);
    }
}
